//数据格式注册——二人牛牛
module RegDataHlsz {
    export let KIND_ID = 500									//游戏 I D
    export let GAME_PLAYER = 5									//游戏人数
    export let GAME_NAME = "诈金花"						//游戏名字
    export let MAX_COUNT = 3									//扑克数目
    export let VERSION_SERVER = "6,0,3"				//程序版本
    export let VERSION_CLIENT = "6,0,3"				//程序版本
    export let GIVE_UP = 2									//放弃概率
    export let LOOK_CARD = 8									//看牌概率
    export let COMPARE_CARD = 5									//比牌概率
    export let MAX_LOOK_INDEX = 10									//看牌索引AA
    export let MAX_OPEN_INDEX = 5									//开牌索引
    export let SERVER_LEN = 32
    export let GER_NO_PLAYER = 0x10								//没有玩家
    export let GER_COMPARECARD = 0x20								//比牌结束
    export let GER_OPENCARD = 0x30								//开牌结束
    export let GER_MAX_TURN = 0x40                                //最大轮数
    export let GS_T_FREE = 0						//等待开始
    export let GS_T_SCORE = 100						//叫分状态
    export let GS_T_PLAYING = 101						//游戏进行
    //BYTE,CHAR 1字节  TCHAR是char数组形式 如果是TCHAR是中文数据则用CHINESE
    //WORD 2字节
    //DWORD int LONG 4字节
    //SCORE 8字节

    //空闲
    export let free = [
        ["lCellScore", "DLONG"],        //基础积分
        ["lRoomStorageStart", "DLONG"],        //房间起始库存
        ["lRoomStorageCurrent", "DLONG"],        //房间当前库存
    ];
    //游戏状态
    export let gameStart = [
        ["lMaxCellScore", "DLONG"],        //单元上限
        ["lCellScore", "DLONG"],        //单元下注
        ["lCurrentTimes", "DLONG"],        //当前倍数
        ["lUserMaxScore", "DLONG"],        //用户分数上限
        ["wBankerUser", "WORD"],        //庄家用户
        ["wCurrentUser", "WORD"],        //当前玩家
        ["cbPlayStatus", "BYTE[]", GAME_PLAYER],        //游戏状态
        ["bMingZhu", "BOOL[]", GAME_PLAYER],        //看牌状态

        ["lTableScore", "DLONG[]", GAME_PLAYER],        //下注数目
        ["lRoomStorageStart", "DLONG"],        //房间起始库存
        ["lRoomStorageCurrent", "DLONG"],        //房间当前库存
        //jiqiren
        ["lRobotScoreMin", "DLONG"],
        ["lRobotScoreMax", "DLONG"],
        ["lRobotBankGet", "DLONG"],
        ["lRobotBankGetBanker", "DLONG"],
        ["lRobotBankStoMul", "DLONG"],

        ["cbHandCardData", "BYTE[]", MAX_COUNT],        //扑克数据
        ["bCompareState", "BOOL"],        //比牌状态
        ["chUserAESKey", "CHAR[]", 16],        //初始密钥
        ["szServerName", "TCHAR", 32],        //房间名称
        ["cbCurrentTimer", "BYTE"],        //当前计时
        ["fCurrentTimes", "FLOAT"],        //当前倍数
        ["cbTurns", "BYTE"],        //当前轮数
    ];

    //请求坐下
    export let CMD_GR_UserSitDown = {
        wMainCmdID: 3,
        wSubCmdID: 3,
        nLenght: 70,
        data: [
            ["wTableID", "WORD"],
            ["wChairID", "WORD"],
            ["szInsurePass", "TCHAR", 33],
        ]
    }
    //游戏配置
    export let CMD_GF_GameOption = {
        wMainCmdID: 100,
        wSubCmdID: 1,
        nLenght: 9,
        data: [
            ["wVisit", "BYTE"],
            ["wVersion", "DWORD"],
            ["wGameVersion", "DWORD"]
        ]
    }
    //准备
    export let CMD_GP_StartGame = {
        wMainCmdID: 100,
        wSubCmdID: 2,
        nLenght: 1,
        data: [

        ]
    }
    //换桌
    export let CMD_GP_ModifyRoom = {
        wMainCmdID: 3,
        wSubCmdID: 10,
        nLenght: 0,
        data: [

        ]
    }
    //用户加注
    export let CMD_GP_AddScore = {
        wMainCmdID: 200,
        wSubCmdID: 1,
        nLenght: 26,
        data: [
            ["lScore", "DLONG"], //加注数目
            ["wState", "WORD"], //1-比牌下注 2-普通下注
            ["keyToken", "TCHAR", 8], //密文
        ]
    }
    //放弃消息
    export let CMD_GP_GiveUp = {
        wMainCmdID: 200,
        wSubCmdID: 2,
        nLenght: 0,
        data: [

        ]
    }
    //比牌消息
    export let CMD_GP_CompareCard = {
        wMainCmdID: 200,
        wSubCmdID: 3,
        nLenght: 2,
        data: [
            ["wCompareUser", "WORD"]//比牌用户
        ]
    }
    //看牌消息
    export let CMD_GP_LookCard = {
        wMainCmdID: 200,
        wSubCmdID: 4,
        nLenght: 0,
        data: [

        ]
    }
    //开牌消息
    export let CMD_GP_OpenCard = {
        wMainCmdID: 200,
        wSubCmdID: 5,
        nLenght: 2,
        data: [
            ["wCompareUser", "WORD"]//比牌用户
        ]
    }
    //用户起立
    export let CMD_GP_StandUp = {
        wMainCmdID: 200,
        wSubCmdID: 11,
        nLenght: 0,
        data: [

        ]
    }
    export let MainCMD_MsgId = {
        1: {
            //登陆成功
            100: [
                ["dwUserRight", "DWORD"],        //用户权限
                ["dwMasterRight", "DWORD"],       //管理权限
            ],
            //登陆失败
            101: [
                ["lErrorCode", "DWORD"],        //错误代码
                ["szDescribeString", "TCHARS", 128],       //描述
            ],
            //登陆完成
            102: [


            ],
            //登陆游戏时发现在其他房间
            103: [
                ["wServerID", "WORD"],        //其他游戏房间的serverID
            ],
            //重选服务器-选桌类型
            104: [

            ],
            //升级提示
            200: [
                ["cbMustUpdatePlaza", "BYTE"],        //强行升级
                ["cbMustUpdateClient", "BYTE"],       //强行升级
                ["cbAdviceUpdateClient", "BYTE"],        //建议升级
                ["dwCurrentPlazaVersion", "DWORD"],       //当前版本
                ["dwCurrentFrameVersion", "DWORD"],        //当前版本
                ["dwCurrentClientVersion", "DWORD"],       //当前版本
            ]
        },

        2: {
            //列表配置
            100: [
                ["cbColumnCount", "BYTE"],      //列表数目
                ["ColumnItem", "STRUCT[]", [
                    ["cbColumnWidth", "BYTE"],        //列表宽度
                    ["cbDataDescribe", "BYTE"],        //字段类型
                    ["szColumnName", "TCHAR", 16],       //列表名字
                ], 16],        //列表描述
            ],
            //房间配置
            101: [
                ["wTableCount", "WORD"],        //桌子数目
                ["wChairCount", "WORD"],        //椅子数目
                ["wServerType", "WORD"],        //房间类型
                ["dwServerRule", "DWORD"],        //房间规则
            ],
            //完成配置
            103: [

            ],
            //玩家权限
            104: [
                ["dwUserRight", "DWORD"],        //玩家权限
            ],
        },


        3: {
            //用户规则
            1: [
                ["cbRuleMask", "BYTE"],        //规则掩码
                ["wMinWinRate", "WORD"],        //最低胜率
                ["wMaxFleeRate", "WORD"],        //最高逃率
                ["lMaxGameScore", "LONG"],        //最高分数
                ["lMinGameScore", "LONG"],        //最低分数
                ["szPassword", "TCHAR", 33],        //桌子密码
            ],
            //旁观请求
            2: [

            ],
            //请求坐下
            3: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["szPassword", "TCHAR", 33],        //桌子密码
            ],
            //拒绝黑名单坐下
            7: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["dwUserID", "TCHAR", 33],        //用户ID
                ["dwRepulseUserID", "DWORD"]        //用户ID
            ],
            //提出用户
            8: [
                ["dwTargetUserID", "DWORD"],        //用户标识
            ],
            //用户信息
            100: [
                ["tagMobileUserInfoHead", "SPSTRUCT", [
                    ["dwGameID", "DWORD"],        //游戏 I D
                    ["dwUserID", "DWORD"],        //用户 I D
                    ["dwGroupID", "DWORD"],        //社团 I D
                    ["wFaceID", "WORD"],        //头像索引
                    ["dwCustomID", "DWORD"],        ////自定标识
                    ["bIsAndroid", "BOOL"],        ////机器标识
                    ["cbGender", "BYTE"],        ////用户性别
                    ["cbMemberOrder", "BYTE"],        ////会员等级
                    ["cbTrader", "BYTE"],        ////管理等级
                    ["wTableID", "WORD"],        ////桌子索引
                    ["wChairID", "WORD"],        ////椅子索引
                    ["cbUserStatus", "BYTE"],        ////用户状态
                    ["lScore", "DLONG"],        ////用户分数  用户的money
                    ["lGrade", "DLONG"],        ////用户成绩
                    ["lInsure", "DLONG"],        ////用户银行
                    ["lIngot", "DLONG"],        ////用户元宝
                    ["dBeans", "DOUBLE"],        ////用户游戏豆
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "DWORD"],        //用户魅力
                    ["lIntegralCount", "DLONG"],        //积分总数
                    ["dwAgentID", "DWORD"],        //代理 I D
                ]]
            ],
            //用户分数
            101: [
                ["dwUserID", "DWORD"],        //桌子位置
                ["UserScore", "STRUCT", [
                    ["lScore", "DLONG"],        //用户分数
                    ["lGrade", "DLONG"],        //用户成绩
                    ["lInsure", "DLONG"],        //用户银行
                    ["lIngot", "DLONG"],        //用户银行
                    ["dBeans", "BYTE"],        //用户银行

                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwUserMedal", "DLONG"],        //用户奖牌
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "DLONG"]        //用户魅力
                ]],        //积分信息
            ],

            //用户状态
            102: [
                ["dwUserID", "DWORD"],        //用户标识
                ["tableId", "WORD"],
                ["wChairID", "WORD"],
                ["cbUserStatus", "BYTE"]
            ],
            //请求失败
            103: [
                ["lErrorCode", "LONG"],        //错误码
                ["wServerType", "WORD"],        //错误码
                ["szDescribeString", "TCHARS", 256]        //描述信息
            ],
            //踢出用户
            104: [
                ["dwTargetUserID", "DWORD"],        //目标用户
            ],
        },

        4: {
            //桌子信息
            100: [
                ["wTableCount", "WORD"],        //桌子数量
                ["TableStatusArray", "STRUCT[]", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                ], 512] //桌子状态
            ],
            //桌子状态
            101: [
                ["wTableID", "WORD"],        //桌子数量
                ["TableStatus", "STRUCT", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                    ["lCellScore", "DLONG"],       //单元积分
                ]] //桌子状态
            ]

        },
        5: {
            //银行资料返回
            100: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["wRevenueTake", "WORD"],        //税收比列
                ["wRevenueTransfer", "WORD"],        //税收比列
                ["wServerID", "WORD"],        //房间标识
                ["lUserScore", "SCORE"],        //用户金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["lTransferPrerequisite", "SCORE"],        //转账条件
            ],
            //银行操作成功
            101: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lUserScore", "SCORE"],        //身上金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
            //银行操作失败
            102: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lErrorCode", "LONG"],        //错误代码
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
        },
        // //管理员命令
        // 6:{
        //     //警告消息
        //     1:[
        //         ["wChatLength", "WORD"],        //信息长度
        //         ["dwTargetUserID", "DWORD"],        //目标用户
        //         ["szWarningMessage", "CHINESE",128],        //警告消息
        //     ],
        //     //接受消息
        //     2:[
        //         ["cbGame", "WORD"],        //游戏标识
        //         ["cbRoom", "DWORD"],        //房间标识
        //         ["cbAllRoom", "CHINESE",128],        //所有房间
        //         ["wChatLength", "DWORD"],              //消息长度
        //         ["szSystemMessage", "CHINESE",128],        //系统消息
        //     ],
        // },

        8: {
            //游戏状态
            100: [
                ["cbGameStatus", "WORD"],        //游戏状态
                ["cbAllowLookon", "DWORD"],        //旁观标志
            ],
            //用户匹配状态
            103: [],
            //可进行游戏状态
            104: [],
            //系统消息
            200: [
                ["wType", "WORD"],        //游戏状态
                ["szName", "DWORD"],        //mingzi
                ["wLength", "WORD"],        //游戏状态
                ["szString", "CHINESE", 1024],        //内容
            ],

        }
        ,
        100: {
            //游戏状态
            100: [
                ["cbGameStatus", "BYTE"],        //游戏状态
                ["cbAllowLookon", "BYTE"],        //旁观标志
            ],
            101: [],
            103: [],
            104: [],
            200: [
                ["wType", "WORD"],        //消息类型
                ["wLength", "WORD"],        //消息长度
                ["szString", "TCHARS", 1024],        //内容
            ],
            300: [
                ["szSerialNumber", "TCHARS", 32] //牌局编号
            ]
        },
        200: {
            //游戏开始
            100: [
                ["lMaxScore", "DLONG"],        //最大下注
                ["lCellScore", "DLONG"],        //单元下注
                ["lCurrentTimes", "DLONG"],        //当前倍数
                ["lUserMaxScore", "DLONG"],        //分数上限
                ["wBankerUser", "WORD"],        //庄家信息
                ["wCurrentUser", "WORD"],        //当前玩家
                ["cbPlayStatus", "BYTE[]", GAME_PLAYER],        //用户状态
                ["cbTurns", "BYTE"],        //当前轮数
            ],
            //下注
            101: [
                ["wCurrentUser", "WORD"],						//当前用户
                ["wAddScoreUser", "WORD"],						//加注用户
                ["wCompareState", "WORD"],						//比牌状态
                ["lAddScoreCount", "DLONG"],						//加注数目
                ["lCurrentTimes", "DLONG"],		           //当前倍数    
                ["cbTurns", "BYTE"],			//当前玩家第几轮
                // ["cbType", "BYTE"],          //类型 1-跟注 2-加注 4-全下          
            ],
            //弃牌
            102: [
                ["wGiveUpUser", "WORD"],						//放弃用户
            ],
            //发牌
            103: [
                ["cbCardData", "BYTE[][]", GAME_PLAYER, MAX_COUNT],		//用户扑克
            ],
            //游戏结束
            104: [
                ["lGameTax", "DLONG"],						//游戏税收
                ["lGameScore", "DLONG[]", GAME_PLAYER],						//游戏得分
                ["cbCardData", "BYTE[][]", GAME_PLAYER, 3],						//用户扑克
                ["wCompareUser", "WORD[][]", GAME_PLAYER, 4],						//比牌用户
                ["wEndState", "WORD"],						//结束状态
                ["bDelayOverGame", "BOOL"],		           //延迟开始    
                ["wServerType", "WORD"],			//房间类型
                ["cbCardType", "BYTE[]", GAME_PLAYER], //牌型
                // ["cbEndType", "BYTE"],          //结束类型 0普通 1-20轮结束  
                // ["lUserScore", "LONGLONG[]", GAME_PLAYER],          //用户当前金币  
            ],
            //比牌
            105: [
                ["wCurrentUser", "WORD"],						//当前用户
                ["wCompareUser", "WORD[]", 2],				    //比牌用户
                ["wLostUser", "WORD"],						//输牌用户
                // ["cbCardData", "BYTE[]", MAX_COUNT],						//用户扑克
            ],
            //看牌
            106: [
                ["wLookCardUser", "WORD"],						//当前用户
                ["cbCardData", "BYTE[]", MAX_COUNT],						//比牌用户
                ["cbCardType", "BYTE"]//牌型
            ],
            //用户退出
            107: [
                ["wPlayerID", "WORD"],						//当前用户
            ],
            //开牌数据
            108: [
                ["wWinner", "WORD"],						//胜利用户
                // ["cbCardData", "BYTE[]", MAX_COUNT],						//用户扑克
                // ["cbCardType", "BYTE"],						//用户牌型
            ],
            //等待比牌
            109: [
                ["wCompareUser", "WORD"],						//比牌用户
            ],
            //智能消息
            110: [
                ["cbRealPlayer", "BYTE[]", GAME_PLAYER],						//真人玩家
                ["cbAndroidStatus", "BYTE[]", GAME_PLAYER],						//机器数目
                ["cbAllHandCardData", "BYTE[][]", GAME_PLAYER, 3],						//手上扑克
                ["wServerID", "WORD"],						//房间ID
                ["wTableID", "WORD"],		           //桌子ID
                ["lStockScore", "LONGLONG"],			//当前库存
                ["lUserScore", "LONGLONG[]", GAME_PLAYER],          //玩家携带金币  
                ["dwUserID", "DWORD[]", GAME_PLAYER],			//用户ID
                ["lGameScore", "LONGLONG[]", GAME_PLAYER],          //输赢金币 
            ],
            //看牌消息
            111: [
                ["cbAllHandCardData", "BYTE[][]", GAME_PLAYER, MAX_COUNT],						//手上扑克
            ],
            //空闲状态
            112: [
                ["lCellScore", "LONGLONG"],						//基础积分
                ["lCellScore", "CHINESE", SERVER_LEN],		           //房间名称
            ],
            //叫分状态
            113: [],
            //游戏状态
            114: [
                ["lMaxCellScore", "LONGLONG"],						//单元上限
                ["lCellScore", "LONGLONG"],						    //单元下注
                ["lCurrentTimes", "LONGLONG"],						//当前倍数
                ["lUserMaxScore", "LONGLONG"],						//用户分数上限
                ["wBankerUser", "WORD"],		                     //庄家用户
                ["wCurrentUser", "WORD"],			                //当前玩家
                ["cbPlayStatus", "BYTE[]", GAME_PLAYER],          //游戏状态  
                ["bMingZhu", "BYTE[]", GAME_PLAYER],			//看牌状态
                ["lTableScore", "LONGLONG[]", GAME_PLAYER],          //下注数目 
                ["szGameRoomName", "CHINESE", SERVER_LEN],          //房间名称  
                ["cbHandCardData", "BYTE[]", MAX_COUNT],			//扑克数据
                ["bCompareState", "BYTE"],          //比牌状态 
            ],
            //游戏信息
            115: [
                ["wTurnCount", "WORD"],						        //当前轮数
                ["wTotalTurnCount", "WORD"],						//总轮数
                ["lSingleScore", "LONGLONG"],						//单注金额
                ["lUserScore", "LONGLONG[]", GAME_PLAYER],			//用户当前金币
            ],
            //机器人信息
            116: [
                ["cbPlayerCount", "BYTE"],						//当前游戏人数
                ["cbLookCount", "BYTE"],						//当前看牌未放弃人数
            ],
            //机器人换牌
            117: [
                ["cbAllHandCardData", "BYTE[][]", GAME_PLAYER, MAX_COUNT],						//手上扑克
            ],



        },
        1000: {
            1: [
                ["wType", "WORD"],  //消息类型 1聊天消息 2弹出消息 4全局消息 8提示消息 16滚动消息
                ["wLength", "WORD"],  //消息长度
                ["szString", "TCHAR", 16],  //消息内容
            ],
        }
    }
    //I D 登录
    export let CMD_GP_LogonMobile = {
        wMainCmdID: 1,
        wSubCmdID: 1,
        nLenght: 216,
        data: [
            ["dwPlazaVersion", "DWORD"],                //dwPlazaVersion广场版本
            ["dwFrameVersion", "DWORD"],       //dwFrameVersion
            ["dwProcessVersion", "DWORD"], //dwProcessVersion
            ["dwUserID", "DWORD"],        //玩家id
            ["szPassword", "TCHAR", 33],        //动态密码
            ["szServerPasswd", "TCHAR", 33],        //szServerPasswd
            ["szMachineID", "TCHAR", 33],        //szMachineID
            ["wGameID", "WORD"],                //游戏id
        ]
    }

}
